<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE HTML>
<html>
<head>
  <title>后台管理系统</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <link href="/resources/css/dpl-min.css" rel="stylesheet" type="text/css" />
  <link href="/resources/css/bui-min.css" rel="stylesheet" type="text/css" />
  <link href="/resources/css/page-min.css" rel="stylesheet" type="text/css" />
</head>
<body>

<div class="container">
  <form id="J_Form" class="form-horizontal" action="/order/save">
    <h3>订单信息</h3>
    <input type="hidden" name="id" id="id" value="${data.id}"/>
    <div class="row">
      <div class="control-group span12">
        <label class="control-label">订单编号：</label>
        <div style="display:inline;height:40px;margin-left: 10px;">
          ${data.no}
        </div>
      </div>

      <div class="control-group span12">
        <label class="control-label">订单时间：</label>
        <div style="display:inline;height:40px;margin-left: 10px;">
          ${data.dateStr}
        </div>
      </div>
    </div>

    <div class="row" >
      <div class="control-group span12">
        <label class="control-label">订单状态：</label>
        <div style="display:inline;margin-left: 10px;">
          <c:if test="${data.status=='Create'}">待支付</c:if>
          <c:if test="${data.status=='Pay'}">待发货</c:if>
          <c:if test="${data.status=='Send'}">已发货</c:if>
          <c:if test="${data.status=='Suc'}">已完成</c:if>
          <c:if test="${data.status=='Close'}">已关闭</c:if>
        </div>
      </div>

      <div class="control-group span12">
        <label class="control-label">订单总金额：</label>
        <div style="display:inline;margin-left: 10px;">
          ${data.totalMoney}
        </div>
      </div>
    </div>

    <div class="row" >
      <div class="control-group span12">
        <label class="control-label">支付金额：</label>
        <div style="display:inline;margin-left: 10px;">
          ${data.payAmount}
        </div>
      </div>

      <div class="control-group span12">
        <label class="control-label">使用余额：</label>
        <div style="display:inline;height:40px;margin-left: 10px;">
          ${data.bonusAmount}
        </div>
      </div>
    </div>

    <div class="row" >
      <div class="control-group span12">
        <label class="control-label">邮费：</label>
        <div style="display:inline;margin-left: 10px;">
          ${data.postAmount}
        </div>
      </div>

      <div class="control-group span12">
        <label class="control-label">备注：</label>
        <div style="display:inline;height:40px;margin-left: 10px;">
          ${data.remark}
        </div>
      </div>
    </div>

    <div class="row" >
      <div class="control-group span12">
        <label class="control-label">消费者id：</label>
        <div style="display:inline;margin-left: 10px;">
            ${user.account}
          </div>
      </div>

      <div class="control-group span12">
        <label class="control-label">消费者名称：</label>
        <div style="display:inline;height:40px;margin-left: 10px;">
          ${data.userName}
          </div>
      </div>
    </div>

    <div class="row" >
      <div class="control-group span12">
        <label class="control-label">支付时间：</label>
        <div style="display:inline;height:40px;margin-left: 10px;">
            ${data.payDateStr}
        </div>
      </div>
      <div class="control-group span12">
        <label class="control-label">发货时间：</label>
        <div style="display:inline;height:40px;margin-left: 10px;">
          ${data.sendDateStr}
        </div>
      </div>
    </div>
    <div class="row" style="margin-top: 5px;">
      <div class="control-group span12">
        <label class="control-label">运单号：</label>
        <div style="display:inline;height:40px;margin-left: 10px;">
          <input type="text" name="billNo" id="billNo" class="span8 span-width control-text bui-form-field" value="${data.billNo}"/>
        </div>
      </div>
    </div>


    <h3>订单产品</h3>
    <c:forEach items="${list}" var="e">
    <div class="row" >
      <div class="control-group span8">
        <div style="width:220px;margin-left: 10px;">
          <c:set var="images" value="${fn:split(e.images,'|')}"/>
          <c:forEach items="${images}" var="d" varStatus="i">
            <c:if test="${i.index==0}">
              <img src="${d}" style="width:100px;height:100px"/>
            </c:if>
          </c:forEach>

            <div style="float:right;">
            产品名称：${e.name} <br/>
            产品单价：${e.price}<br/>
            产品数量：${e.num}
            </div>
        </div>
      </div>
    </div>
    </c:forEach>


    <h3>收货信息</h3>
    <div class="row">
      <div class="control-group span20">
        <label class="control-label">收货人：</label>
        <div style="display:inline;height:40px;margin-left: 10px;">
          ${data.userName}
        </div>
      </div>

      <div class="control-group span20">
        <label class="control-label">联系电话：</label>
        <div style="display:inline;height:40px;margin-left: 10px;">
            ${data.telephone}
          </div>
      </div>
    </div>

    <div class="row" >
      <div class="control-group span12">
        <label class="control-label">收货地市：</label>
        <div style="display:inline;height:40px;margin-left: 10px;">
            ${data.provinceName}/${data.cityName}/${data.areaName}
          </div>
      </div>

      <div class="control-group span12">
        <label class="control-label">详细地址：</label>
        <div style="display:inline;height:40px;margin-left: 10px;">
            ${data.address}
          </div>
      </div>
    </div>


    <div class="row form-actions actions-bar">
      <div class="span13 offset3 ">
        <button type="submit" class="button button-primary" >确定</button>
       <button type="button" class="button" onclick="back()">返回</button>
      </div>
    </div>
  </form>
</div>
<script type="text/javascript" src="/resources/js/jquery-1.8.1.min.js"></script>
<script type="text/javascript" src="/resources/js/sea.js"></script>
<script type="text/javascript" src="/resources/js/bui-min.js"></script>
<script type="text/javascript" src="/resources/js/config-min.js"></script>

<script type="text/javascript">
  BUI.use('common/page'); //页面链接跳转
  BUI.use(['bui/tree','bui/form','bui/select','bui/data'],function (Tree,Form,Select,Data) {
    var form = new Form.HForm({
      srcNode : '#J_Form',
      submitType:"ajax",
      listeners:{
        beforesubmit:function(){
          return true;
        }
      },
      callback:function(data){
        BUI.Message.Alert(data.msg,function(){
          if(data.success){
            back();
          }
        },'info');
      }
    });
    form.render();
  });

  function back(){
    top.topManager.openPage({
      id : 'order_list'
    });

  }

</script>

</body>
</html> 